package com.yuyou.tas.lesson.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yuyou.tas.lesson.service.ILessonChapterService;
import com.yuyou.tas.lesson.service.ILessonService;
import com.yuyou.tas.service.api.lesson.entity.Lesson;
import com.yuyou.tas.service.api.lesson.entity.LessonChapter;
import com.yuyou.tas.service.api.lesson.service.LessonAPI;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;

@RestController
public class LessonAPIImpl implements LessonAPI{

	@Autowired
	private ILessonService lessonService;
	
	@Autowired
	private ILessonChapterService lessonChapterService;
	
	@Override
	public ResBoolSimpleInfo<String> sycnLessonsByOId(@RequestBody List<Lesson> record) throws Exception {
		return lessonService.syncLessons(record);
	}

	@Override
	public ResBoolSimpleInfo<String> delByOrgan7OIds(@RequestParam("oIds") List<Long> oIds,@RequestParam("authOrganizationId") Long authOrganizationId)
			throws Exception {
		return lessonService.delByOrgan7OIds(oIds, authOrganizationId);
	}

	@Override
	public Lesson getById(Long id) {
		return lessonService.selectByPrimaryKey(id);
	}




}
